/*     */ package com.jcrj.service;
/*     */ 
/*     */ import com.jcrj.dao.SearchDao;
/*     */ import com.jcrj.dto.ColumnDTO;
/*     */ import com.jcrj.dto.FieldDTO;
/*     */ import com.jcrj.dto.SearchDTO;
/*     */ import com.jcrj.entity.OInfo;
/*     */ import com.jcrj.entity.OMailReceiver;
/*     */ import com.jcrj.entity.OTask;
/*     */ import java.util.List;
/*     */ 
/*     */ public class SearchService
/*     */ {
/*     */   private SearchDao searchDao;
/*     */ 
/*     */   public SearchDao getSearchDao()
/*     */   {
/*  17 */     return this.searchDao;
/*     */   }
/*     */ 
/*     */   public void setSearchDao(SearchDao searchDao) {
/*  21 */     this.searchDao = searchDao;
/*     */   }
/*     */ 
/*     */   public FieldDTO[] getFieldsByEntity(SearchDTO searchDTO) {
/*  25 */     if ("OTask".equals(searchDTO.getEntityName())) {
/*  26 */       return new FieldDTO[] { new FieldDTO("日程主题", "title", "checkbox"), 
/*  27 */         new FieldDTO("创建日期", "creationTime", "time") };
/*     */     }
/*  29 */     if ("OInfo".equals(searchDTO.getEntityName()))
/*  30 */       return new FieldDTO[] { 
/*  31 */         new FieldDTO("上报人", "userName", "checkbox"), 
/*  32 */         new FieldDTO("信息标题", "title", "checkbox"), 
/*  33 */         new FieldDTO("创建日期", "createTime", "time"), 
/*  34 */         new FieldDTO("发布状态", "publish", "selectPublish") };
/*  35 */     if ("OMailReceiver".equals(searchDTO.getEntityName())) {
/*  36 */       return new FieldDTO[] { 
/*  37 */         new FieldDTO("优先级", "inMail.status", "checkbox"), 
/*  38 */         new FieldDTO("主题", "inMail.title", "checkbox"), 
/*  39 */         new FieldDTO("发件人", "inMail.sendName", "checkbox"), 
/*  40 */         new FieldDTO("发件日期", "inMail.createTime", "time"), 
/*  41 */         new FieldDTO("状态", "ifRead", "selectIfRead") };
/*     */     }
/*  43 */     return null;
/*     */   }
/*     */ 
/*     */   public ColumnDTO[] getColumns()
/*     */   {
/*  48 */     return new ColumnDTO[] { new ColumnDTO("个人日程", "OTask", "0"), 
/*  49 */       new ColumnDTO("信息管理", "OInfo", "0"), 
/*  50 */       new ColumnDTO("邮件系统", "OMailReceiver", "0") };
/*     */   }
/*     */ 
/*     */   public List<OTask> getOTaskData(SearchDTO searchDTO, int currentPage, String startDate, String endDate)
/*     */   {
/*  55 */     int tag = 0;
/*  56 */     String hql = "from OTask o";
/*  57 */     if ((searchDTO.getColumnNames() != null) && 
/*  58 */       (searchDTO.getColumnNames().length > 0) && 
/*  59 */       (searchDTO.getSearchContent() != null) && 
/*  60 */       (!"".equals(searchDTO.getSearchContent()))) {
/*  61 */       hql = hql + " where o." + searchDTO.getColumnNames()[0] + " like '%" + 
/*  62 */         searchDTO.getSearchContent() + "%'";
/*     */ 
/*  64 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/*  65 */         hql = hql + " and o.creationTime >= to_date('" + startDate + 
/*  66 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/*  68 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/*  69 */         hql = hql + " and o.creationTime <= to_date('" + endDate + 
/*  70 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/*  72 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/*  73 */         hql = hql + " or o." + searchDTO.getColumnNames()[i] + " like '%" + 
/*  74 */           searchDTO.getSearchContent() + "%'";
/*     */ 
/*  76 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/*  77 */           hql = hql + " and o.creationTime >= to_date('" + startDate + 
/*  78 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/*  80 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/*  81 */           hql = hql + " and o.creationTime <= to_date('" + endDate + 
/*  82 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/*     */       }
/*  85 */       hql = hql + " order by o.id desc";
/*  86 */       return this.searchDao.findByPage(hql, currentPage);
/*     */     }
/*  88 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/*  89 */       if (tag == 0)
/*  90 */         hql = hql + " where o.creationTime >= to_date('" + startDate + 
/*  91 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/*  93 */         hql = hql + " and o.creationTime >= to_date('" + startDate + 
/*  94 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/*  96 */       tag++;
/*     */     }
/*  98 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/*  99 */       if (tag == 0)
/* 100 */         hql = hql + " where o.creationTime <= to_date('" + endDate + 
/* 101 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 103 */         hql = hql + " and o.creationTime <= to_date('" + endDate + 
/* 104 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 106 */       tag++;
/*     */     }
/* 108 */     hql = hql + " order by o.id desc";
/* 109 */     return this.searchDao.findByPage(hql, currentPage);
/*     */   }
/*     */ 
/*     */   public long getOTaskTotalCount(SearchDTO searchDTO, String startDate, String endDate)
/*     */   {
/* 114 */     int tag = 0;
/* 115 */     String hql = "select count(*) from OTask o";
/* 116 */     if ((searchDTO.getColumnNames() != null) && 
/* 117 */       (searchDTO.getColumnNames().length > 0) && 
/* 118 */       (searchDTO.getSearchContent() != null) && 
/* 119 */       (!"".equals(searchDTO.getSearchContent()))) {
/* 120 */       hql = hql + " where o." + searchDTO.getColumnNames()[0] + " like '%" + 
/* 121 */         searchDTO.getSearchContent() + "%'";
/*     */ 
/* 123 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 124 */         hql = hql + " and o.creationTime >= to_date('" + startDate + 
/* 125 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 127 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 128 */         hql = hql + " and o.creationTime <= to_date('" + endDate + 
/* 129 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 131 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/* 132 */         hql = hql + " or o." + searchDTO.getColumnNames()[i] + " like '%" + 
/* 133 */           searchDTO.getSearchContent() + "%'";
/* 134 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 135 */           hql = hql + " and o.creationTime >= to_date('" + startDate + 
/* 136 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 138 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 139 */           hql = hql + " and o.creationTime <= to_date('" + endDate + 
/* 140 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/*     */       }
/* 143 */       return this.searchDao.countTotalByHql(hql).longValue();
/*     */     }
/* 145 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 146 */       if (tag == 0)
/* 147 */         hql = hql + " where o.creationTime >= to_date('" + startDate + 
/* 148 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 150 */         hql = hql + " and o.creationTime >= to_date('" + startDate + 
/* 151 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 153 */       tag++;
/*     */     }
/* 155 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 156 */       if (tag == 0)
/* 157 */         hql = hql + " where o.creationTime <= to_date('" + endDate + 
/* 158 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 160 */         hql = hql + " and o.creationTime <= to_date('" + endDate + 
/* 161 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 163 */       tag++;
/*     */     }
/* 165 */     return this.searchDao.countTotalByHql(hql).longValue();
/*     */   }
/*     */ 
/*     */   public List<OInfo> getOInfoData(SearchDTO searchDTO, int currentPage, String startDate, String endDate, String publish)
/*     */   {
/* 170 */     int tag = 0;
/* 171 */     String hql = "from OInfo o";
/* 172 */     if ((searchDTO.getColumnNames() != null) && 
/* 173 */       (searchDTO.getColumnNames().length > 0) && 
/* 174 */       (searchDTO.getSearchContent() != null) && 
/* 175 */       (!"".equals(searchDTO.getSearchContent()))) {
/* 176 */       hql = hql + " where o." + searchDTO.getColumnNames()[0] + " like '%" + 
/* 177 */         searchDTO.getSearchContent() + "%'";
/* 178 */       if ((publish != null) && (!"-1".equals(publish))) {
/* 179 */         hql = hql + " and o.publish='" + publish + "'";
/*     */       }
/* 181 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 182 */         hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 183 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 185 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 186 */         hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 187 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 189 */       hql = hql + " and o.del='0'";
/* 190 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/* 191 */         hql = hql + " or o." + searchDTO.getColumnNames()[i] + " like '%" + 
/* 192 */           searchDTO.getSearchContent() + "%'";
/* 193 */         if ((publish != null) && (!"-1".equals(publish))) {
/* 194 */           hql = hql + " and o.publish='" + publish + "'";
/*     */         }
/* 196 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 197 */           hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 198 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 200 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 201 */           hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 202 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 204 */         hql = hql + " and o.del='0'";
/*     */       }
/* 206 */       hql = hql + " order by o.id desc";
/* 207 */       return this.searchDao.findByPage(hql, currentPage);
/*     */     }
/* 209 */     if ((publish != null) && (!"-1".equals(publish))) {
/* 210 */       hql = hql + " where o.publish='" + publish + "'";
/* 211 */       tag++;
/*     */     }
/* 213 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 214 */       if (tag == 0)
/* 215 */         hql = hql + " where o.createTime >= to_date('" + startDate + 
/* 216 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 218 */         hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 219 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 221 */       tag++;
/*     */     }
/* 223 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 224 */       if (tag == 0)
/* 225 */         hql = hql + " where o.createTime <= to_date('" + endDate + 
/* 226 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 228 */         hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 229 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 231 */       tag++;
/*     */     }
/* 233 */     if (tag == 0)
/* 234 */       hql = hql + " where o.del='0'";
/*     */     else {
/* 236 */       hql = hql + " and o.del='0'";
/*     */     }
/* 238 */     hql = hql + " order by o.id desc";
/* 239 */     return this.searchDao.findByPage(hql, currentPage);
/*     */   }
/*     */ 
/*     */   public long getOInfoTotalCount(SearchDTO searchDTO, String startDate, String endDate, String publish)
/*     */   {
/* 244 */     int tag = 0;
/* 245 */     String hql = "select count(*) from OInfo o";
/* 246 */     if ((searchDTO.getColumnNames() != null) && 
/* 247 */       (searchDTO.getColumnNames().length > 0) && 
/* 248 */       (searchDTO.getSearchContent() != null) && 
/* 249 */       (!"".equals(searchDTO.getSearchContent()))) {
/* 250 */       hql = hql + " where o." + searchDTO.getColumnNames()[0] + " like '%" + 
/* 251 */         searchDTO.getSearchContent() + "%'";
/* 252 */       if ((publish != null) && (!"-1".equals(publish))) {
/* 253 */         hql = hql + " and o.publish='" + publish + "'";
/*     */       }
/* 255 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 256 */         hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 257 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 259 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 260 */         hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 261 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 263 */       hql = hql + " and o.del='0'";
/* 264 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/* 265 */         hql = hql + " or o." + searchDTO.getColumnNames()[i] + " like '%" + 
/* 266 */           searchDTO.getSearchContent() + "%'";
/* 267 */         if ((publish != null) && (!"-1".equals(publish))) {
/* 268 */           hql = hql + " and o.publish='" + publish + "'";
/*     */         }
/* 270 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 271 */           hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 272 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 274 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 275 */           hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 276 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 278 */         hql = hql + " and o.del='0'";
/*     */       }
/* 280 */       return this.searchDao.countTotalByHql(hql).longValue();
/*     */     }
/* 282 */     if ((publish != null) && (!"-1".equals(publish))) {
/* 283 */       hql = hql + " where o.publish='" + publish + "'";
/* 284 */       tag++;
/*     */     }
/* 286 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 287 */       if (tag == 0)
/* 288 */         hql = hql + " where o.createTime >= to_date('" + startDate + 
/* 289 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 291 */         hql = hql + " and o.createTime >= to_date('" + startDate + 
/* 292 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 294 */       tag++;
/*     */     }
/* 296 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 297 */       if (tag == 0)
/* 298 */         hql = hql + " where o.createTime <= to_date('" + endDate + 
/* 299 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 301 */         hql = hql + " and o.createTime <= to_date('" + endDate + 
/* 302 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 304 */       tag++;
/*     */     }
/* 306 */     if (tag == 0)
/* 307 */       hql = hql + " where o.del='0'";
/*     */     else {
/* 309 */       hql = hql + " and o.del='0'";
/*     */     }
/* 311 */     return this.searchDao.countTotalByHql(hql).longValue();
/*     */   }
/*     */ 
/*     */   public List<OMailReceiver> getOMailReceiverData(SearchDTO searchDTO, int userId, int currentPage, String startDate, String endDate, String ifRead)
/*     */   {
/* 317 */     int tag = 0;
/* 318 */     String hql = "from OMailReceiver o";
/* 319 */     if ((searchDTO.getColumnNames() != null) && 
/* 320 */       (searchDTO.getColumnNames().length > 0) && 
/* 321 */       (searchDTO.getSearchContent() != null) && 
/* 322 */       (!"".equals(searchDTO.getSearchContent()))) {
/* 323 */       hql = hql + " where dbms_lob.instr(o." + searchDTO.getColumnNames()[0] + 
/* 324 */         ",'" + searchDTO.getSearchContent() + "',1,1)>0";
/* 325 */       if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 326 */         hql = hql + " and o.ifRead='" + ifRead + "'";
/*     */       }
/* 328 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 329 */         hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 330 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 332 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 333 */         hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 334 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 336 */       hql = hql + " and o.del='0' and o.receiverId=" + userId;
/* 337 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/* 338 */         hql = hql + " or dbms_lob.instr(o." + searchDTO.getColumnNames()[i] + 
/* 339 */           ",'" + searchDTO.getSearchContent() + "',1,1)>0";
/* 340 */         if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 341 */           hql = hql + " and o.ifRead='" + ifRead + "'";
/*     */         }
/* 343 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 344 */           hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 345 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 347 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 348 */           hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 349 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 351 */         hql = hql + " and o.del='0' and o.receiverId=" + userId;
/*     */       }
/* 353 */       hql = hql + " order by o.ifRead,o.id desc";
/* 354 */       return this.searchDao.findByPage(hql, currentPage);
/*     */     }
/* 356 */     if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 357 */       hql = hql + " where o.ifRead='" + ifRead + "'";
/* 358 */       tag++;
/*     */     }
/* 360 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 361 */       if (tag == 0)
/* 362 */         hql = hql + " where o.inMail.createTime >= to_date('" + startDate + 
/* 363 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 365 */         hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 366 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 368 */       tag++;
/*     */     }
/* 370 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 371 */       if (tag == 0)
/* 372 */         hql = hql + " where o.inMail.createTime <= to_date('" + endDate + 
/* 373 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 375 */         hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 376 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 378 */       tag++;
/*     */     }
/* 380 */     if (tag == 0)
/* 381 */       hql = hql + " where o.del='0' and o.receiverId=" + userId;
/*     */     else {
/* 383 */       hql = hql + " and o.del='0' and o.receiverId=" + userId;
/*     */     }
/* 385 */     hql = hql + " order by o.ifRead,o.id desc";
/* 386 */     return this.searchDao.findByPage(hql, currentPage);
/*     */   }
/*     */ 
/*     */   public long getOMailReceiverTotalCount(SearchDTO searchDTO, int userId, String startDate, String endDate, String ifRead)
/*     */   {
/* 391 */     int tag = 0;
/* 392 */     String hql = "select count(*) from OMailReceiver o";
/* 393 */     if ((searchDTO.getColumnNames() != null) && 
/* 394 */       (searchDTO.getColumnNames().length > 0) && 
/* 395 */       (searchDTO.getSearchContent() != null) && 
/* 396 */       (!"".equals(searchDTO.getSearchContent()))) {
/* 397 */       hql = hql + " where dbms_lob.instr(o." + searchDTO.getColumnNames()[0] + 
/* 398 */         ",'" + searchDTO.getSearchContent() + "',1,1)>0";
/* 399 */       if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 400 */         hql = hql + " and o.ifRead='" + ifRead + "'";
/*     */       }
/* 402 */       if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 403 */         hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 404 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 406 */       if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 407 */         hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 408 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 410 */       hql = hql + " and o.del='0' and o.receiverId=" + userId;
/* 411 */       for (int i = 1; i < searchDTO.getColumnNames().length; i++) {
/* 412 */         hql = hql + " or dbms_lob.instr(o." + searchDTO.getColumnNames()[i] + 
/* 413 */           ",'" + searchDTO.getSearchContent() + "',1,1)>0";
/* 414 */         if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 415 */           hql = hql + " and o.ifRead='" + ifRead + "'";
/*     */         }
/* 417 */         if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 418 */           hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 419 */             " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 421 */         if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 422 */           hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 423 */             " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */         }
/* 425 */         hql = hql + " and o.del='0' and o.receiverId=" + userId;
/*     */       }
/* 427 */       return this.searchDao.countTotalByHql(hql).longValue();
/*     */     }
/* 429 */     if ((ifRead != null) && (!"-1".equals(ifRead))) {
/* 430 */       hql = hql + " where o.ifRead='" + ifRead + "'";
/* 431 */       tag++;
/*     */     }
/* 433 */     if ((startDate != null) && (!"".equals(startDate.trim()))) {
/* 434 */       if (tag == 0)
/* 435 */         hql = hql + " where o.inMail.createTime >= to_date('" + startDate + 
/* 436 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 438 */         hql = hql + " and o.inMail.createTime >= to_date('" + startDate + 
/* 439 */           " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 441 */       tag++;
/*     */     }
/* 443 */     if ((endDate != null) && (!"".equals(endDate.trim()))) {
/* 444 */       if (tag == 0)
/* 445 */         hql = hql + " where o.inMail.createTime <= to_date('" + endDate + 
/* 446 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       else {
/* 448 */         hql = hql + " and o.inMail.createTime <= to_date('" + endDate + 
/* 449 */           " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
/*     */       }
/* 451 */       tag++;
/*     */     }
/* 453 */     if (tag == 0)
/* 454 */       hql = hql + " where o.del='0' and o.receiverId=" + userId;
/*     */     else {
/* 456 */       hql = hql + " and o.del='0' and o.receiverId=" + userId;
/*     */     }
/* 458 */     return this.searchDao.countTotalByHql(hql).longValue();
/*     */   }
/*     */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.service.SearchService
 * JD-Core Version:    0.6.0
 */